<?php defined('SYSPATH') OR die('No direct access allowed.');

class Model_Profile extends ORM 
{
	protected $_belongs_to = array('user' => array('model' => 'user', 'foreign_key' => 'user_id'));
	
	protected $_rules = array
	(
		'imie'			=> array
		(
			'not_empty'		=> NULL
		),
		'nazwisko'			=> array
		(
			'not_empty'		=> NULL
		)
	);
	
	public function validate(& $array) 
	{	
		$array = Validate::factory($array)
						->rules('imie', $this->_rules['imie'])
						->rules('nazwisko', $this->_rules['nazwisko'])
						->filter('imie', 'trim')
						->filter('nazwisko', 'trim');
		return $array;
	}
}